import { DEFAULT_HOME_PATH } from "@/config";
import { TestPage } from "./other";

const BasicLayout = () => import("@/layouts/default.vue");

// 我还是习惯在layout 中
const fallbackNotFoundRoute = {
  component: BasicLayout,
  path: "/:pathMatch(.*)*",
  name: "NotFound",
  // redirect: "/404"
  children: [
    {
      path: "/:pathMatch(.*)*",
      name: "NotFoundPage",
      component: () => import("@/pages/exception/not-found.vue"),
      meta: {
        title: "404"
      }
    }
  ]
};

// 基本路由 必须存在
const coreRoutes = [
  /**
   * 根路由
   * 使用基础布局，作为所有页面的父级容器，子级就不必配置BasicLayout。
   * 此路由必须存在，且不应修改
   */
  {
    component: BasicLayout,
    path: "/",
    name: "Root",
    redirect: DEFAULT_HOME_PATH,
    children: [],
    meta: {
      title: "Root"
    }
  },

  TestPage
];

export { coreRoutes, fallbackNotFoundRoute };
